        public string NpoiWorkbookToHtml(IWorkbook workbook)
        {
            var sheetMark = 0;
            var sheet = workbook.GetSheetAt(sheetMark++);
            var sb = new System.Text.StringBuilder();
            while (sheet != null)
            {
                var mergresCount = sheet.NumMergedRegions;
                var merges = new List<NPOI.SS.Util.CellRangeAddress>();
                for (int i = 0; i < mergresCount; i++)
                {
                    merges.Add(sheet.GetMergedRegion(i));
                }
                var rowMark = 0;
                var row = sheet.GetRow(rowMark++);
                var rowIndex = 0;
                sb.AppendLine("<table>");
                while (row != null)
                {
                    sb.AppendLine("<tr>");
                    var cellIndex = 0;
                    foreach (var item in row.Cells)
                    {
                        var _m = merges.FirstOrDefault(v => rowIndex > v.FirstRow && rowIndex <= v.LastRow && v.FirstColumn == cellIndex);
                        while (_m != null)
                        {
                            cellIndex = _m.LastColumn + 1;
                            _m = merges.FirstOrDefault(v => rowIndex > v.FirstRow && rowIndex <= v.LastRow && v.FirstColumn == cellIndex);
                        }
                        var merge = merges.FirstOrDefault(v => v.FirstRow == rowIndex && v.FirstColumn == cellIndex);
                        if (merge != null)
                        {
                            cellIndex = merge.LastColumn;
                        }
                        sb.AppendLine(string.Format("<td rowspan=\"{0}\" colspan=\"{1}\">", (merge != null ? (merge.LastRow - merge.FirstRow + 1) : 1), (merge != null ? (merge.LastColumn - merge.FirstColumn + 1) : 1)));
                        sb.AppendLine(item.ToString());
                        sb.AppendLine("</td>");
                        cellIndex++;
                    }
                    sb.AppendLine("</tr>");
                    row = sheet.GetRow(rowMark++);
                    rowIndex++;
                }
                try
                {
                    sheet = workbook.GetSheetAt(sheetMark++);
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    sheet = null;
                }
                sb.AppendLine("</table>");
            }

            return sb.ToString();
        }